package com.sumer.psychology.comment.domain.model;

import java.io.Serializable;

/**
 * 评论唯一键
 * <p/>
 * User: zhenguang.zhu
 * Date: 2014/8/14
 * Time: 15:11
 */
public class CommentId implements Serializable {
    private String identity;

    public CommentId() {
    }

    public CommentId(String identity) {
        this.identity = identity;
    }

    public String identity() {
        return identity;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CommentId commentId = (CommentId) o;

        if (identity != null ? !identity.equals(commentId.identity) : commentId.identity != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return identity != null ? identity.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "CommentId{" +
                "identity='" + identity + '\'' +
                '}';
    }
}
